<!--  -->
<template>
    <div class="mask" @click="$emit('closeCoupon')" v-if="couponFlag">
        <div class="content flex" @click.stop>
            <span class="remove" @click="$emit('closeCoupon')"></span>
            <div class="name">{{couponInfo.coupon_name}}</div>
            <div class="price mt-8">{{couponInfo.coupon_price}}</div>
            <div class="info">
                <div class="shop-name">店名：{{couponInfo.shop_name}}</div>
                <div class="address">地址：{{couponInfo.shop_address}}</div>
                <div class="tel">电话：{{couponInfo.shop_mobile}}</div>
                <div class="rule">
                    优惠券使用规则：{{couponInfo.coupon_tag}}
                </div>
                <template v-for="(item,index) in 1">
                    <div class="rule-item" :key="index">
                         {{couponInfo.coupon_limit}}
                    </div>
                </template>
            </div>
        </div>
    </div>
</template>

<script>
export default {
  components: {},
  props: {
    couponFlag: {
      type: Boolean,
      default: () => {
        return false;
      },
      required: true
    },
    couponInfo:{
      type:Object,
      default:()=>{
        return {}
      },
      required:true
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {},
  updated() {}, //生命周期 - 更新之后
  destroyed() {} //生命周期 - 销毁完成
};
</script>
<style lang='less' scoped>
//@import url(); 引入公共css类
.mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
  &::before {
    content: "";
    display: inline-block;
    vertical-align: middle;
    height: 100%;
  }
}
.content {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  flex-direction: column;
  z-index: 998;
  padding: 30px 17px;
  width: 216px;
  height: 319px;
  border-radius: 5px;
  background: url("../assets/imgs/coupon.png");
  background-size: 100% 100%;
  animation: show 0.3s 1;
  color: #E33730;
  box-shadow: 14px 25px 16px 7px rgba(0, 0, 0, 0.05);
  @keyframes show {
    0% {
      opacity: 0;
      transform: scale(1.5);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
  .remove {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    height: 27px;
    width: 27px;
    background: url("../assets/imgs/remove.png");
    background-size: 100% 100%;
  }
  .name{
      font-size: 30px;
      font-weight: bold;
  }
  .price{
      display: inline-block;
      padding: 5px 19px;
      border-radius:10px;
      border:1px solid #FA6544;
  }
  .info{
      margin-top: 77px;
      font-size: 12px;
      line-height: 20px;
      text-align: left; 
      text-indent: 17px;
      color:rgba(239,89,58,1);
      .shop-name{

      }
  }
}
</style>